import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    // {
    //   path: '/',
    //   name: 'home',
    //   component: HomeView
    // },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/AboutView.vue')
    }, {
      path: '/Login',
      name: 'Login',
      component: () => import('../views/RbacMan/Login.vue')

    }, {

      path: '/Mainindex',
      name: 'Mainindex',
      component: () => import('../views/Mainindex.vue'),
      children: [

        {

          path: '/UserList',
          name: 'UserList',
          component: () => import('../views/RbacMan/UserList.vue')

        }, {

          path: '/RoleList',
          name: 'RoleList',
          component: () => import('../views/RbacMan/RoleList.vue')

        }, {

          path: '/MeunList',
          name: 'MeunList',
          component: () => import('../views/RbacMan/MeunList.vue')

        }]

    }, {
      path: '/',
      name: 'SourceManList',
      component: () => import('../views/SourceMan/SourceManList.vue')
    }, {
      path: '/SourceDetail',
      name: 'SourceDetail',
      component: () => import('../views/SourceMan/SourceDetail.vue')
    }, {
      path: '/AquacultInfo',
      name: 'AquacultInfo',
      component: () => import('../views/SourceMan/AquacultInfo.vue')
    }, {
      path: '/SlaughterInfo',
      name: 'SlaughterInfo',
      component: () => import('../views/SourceMan/SlaughterInfo.vue')
    }, {
      path: '/DeepProcess',
      name: 'DeepProcess',
      component: () => import('../views/SourceMan/DeepProcess.vue')
    }
  ]
})

export default router
